package zyh.struts2.action2;

import com.opensymphony.xwork2.ActionSupport;
import zyh.hibernate.pojo.News;
import zyh.service.iface.INewsService;

import java.util.List;

public class NewsAction extends ActionSupport {
    private GridData gridData;
    private INewsService newsService;
    public String findAll() throws Exception{
        List<News> newsList=newsService.findAll();
        gridData=new GridData(newsList.size(),newsList);
        return SUCCESS;
    }
    public GridData getGridData() { return gridData; }

    public void setGridData(GridData gridData) { this.gridData = gridData; }

    public INewsService getNewsService() { return newsService; }

    public void setNewsService(INewsService newsService) { this.newsService = newsService; }
}
